class Shapedemo extends egret.DisplayObjectContainer{
    public constructor(){
        super();
        this.shape();
    }
    private shape(){
        var img:egret.Shape = new egret.Shape();
        //img.x = 20;
        //img.y = 20;
        //img.graphics.lineStyle(10,0x0000ff,1,true)
        img.graphics.beginFill(0xff0000,1);
        img.graphics.drawRect(0,0,100,200);
        img.graphics.endFill();
        this.addChild(img);
        // var mask:egret.Rectangle = new egret.Rectangle(20,20,20,20);
        // img.mask = mask;
        var circle:egret.Shape = new egret.Shape();
        circle.graphics.beginFill(0x0000ff,1);
        circle.graphics.drawCircle(25,25,25);
        circle.graphics.endFill();
        this.addChild(circle);
        //img.mask = circle;//遮罩
        var isHit:boolean = img.hitTestPoint(10,10,true);//碰撞检测，true:必须在被检测对象里面才行
        console.log(isHit);

        var cookies =egret.localStorage;
        cookies.setItem("name","刘盼520");
        console.log(cookies.getItem("name"));
        
        var buffer = new ArrayBuffer(8);
        var base = egret.Base64Util;
        console.log(base.encode(buffer))//编码base64
        console.log(base.decode("AAAAAAAAAA="))//解码base64
    }
}